<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

use Illuminate\Support\Facades\Route;

use App\Http\Controllers\Admin\IndexController;
use App\Http\Controllers\Admin\LoginController;
use App\Http\Controllers\Admin\OrderController;
use App\Http\Controllers\Admin\StockOrderController;
use App\Http\Controllers\Admin\StoreController;
use App\Http\Controllers\Admin\SystemController;
use App\Http\Controllers\Admin\GoodsController;
use App\Http\Controllers\Admin\SalesController;
use App\Http\Controllers\Admin\FinancialController;
use App\Http\Controllers\Admin\StoreGoodsViewPermissionsListController;
use App\Http\Controllers\Admin\SalesStrategyViewPermissionsListController;

# 后台主页
Route::any('/admin', [IndexController::class, 'index']);

Route::prefix('admin')->group(function () {
    Route::group(['namespace' => 'Admin'], function () {
        # 后台登陆
        Route::any('/login', [LoginController::class, 'index']);
        Route::any('/login/test', [LoginController::class, 'test']);
        # 后台登陆退出
        Route::any('/loginout', [IndexController::class, 'loginOut']);

        # 首页
        Route::any('/index/welcome', [IndexController::class, 'welcome']);
        Route::any('/index/imageUpload', [IndexController::class, 'imageUpload']);
        Route::any('/index/layui/uploadImage', [IndexController::class, 'layuiUploadImage']);
        Route::any('/index/numberStatistic', [IndexController::class, 'getNumberStatistic']);

        # ==== 系统设置 ====
        # 管理员管理
        Route::any('/system/userList', [SystemController::class, 'userList']);
        Route::any('/system/userEdit', [SystemController::class, 'userEdit']);
        Route::any('/system/userPassword', [SystemController::class, 'userPassword']);
        Route::any('/system/userDel', [SystemController::class, 'userDel']);
        Route::any('/system/roleList', [SystemController::class, 'roleList']);
        Route::any('/system/roleEdit', [SystemController::class, 'roleEdit']);
        Route::any('/system/roleDel', [SystemController::class, 'roleDel']);
        # 菜单管理
        Route::any('/system/navList', [SystemController::class, 'navList']);
        Route::any('/system/navAdd', [SystemController::class, 'navAdd']);
        Route::any('/system/navDel', [SystemController::class, 'navDel']);
        Route::any('/system/navEdit', [SystemController::class, 'navEdit']);
        # 广告图管理
        Route::any('/system/adList', [SystemController::class, 'adList']);
        Route::any('/system/adEdit', [SystemController::class, 'adEdit']);
        Route::any('/system/adDel', [SystemController::class, 'adDel']);
        Route::any('/system/adCateList', [SystemController::class, 'adCateList']);
        Route::any('/system/adCateEdit', [SystemController::class, 'adCateEdit']);
        Route::any('/system/adCateDel', [SystemController::class, 'adCateDel']);


        # ==== 销售管理 ====
        # 销售管理
        Route::get('/order/orderList', [OrderController::class, 'orderList']);
        Route::any('/order/orderEdit', [OrderController::class, 'orderEdit']); //出货订单审核编辑
        Route::post('/order/freightAndAmount', [OrderController::class, 'freightAndAmount']);        # 动态获取运费
        Route::get('/order/expressList', [OrderController::class, 'expressList']);
        Route::any('/order/expressEdit', [OrderController::class, 'expressEdit']);
        Route::any('/order/orderPdf', [OrderController::class, 'orderPdf']);
        Route::any('/order/storeYzMoney', [OrderController::class, 'storeYzMoney']);
        Route::any('/order/orderDel', [OrderController::class, 'orderDel']);
        Route::any('/order/calcAmount', [OrderController::class, 'calcAmount']);

        # ==== 销售策略 ====
        Route::any('/sales/amountStrategyList', [SalesController::class, 'amountStrategyList']);
        Route::any('/sales/itemStrategyList', [SalesController::class, 'itemStrategyList']);
        Route::any('/sales/strategyInfo/ajax', [SalesController::class, 'ajaxGetStrategyInfo']);
        Route::any('/sales/strategyAdd', [SalesController::class, 'salesStrategyAdd']);
        Route::any('/sales/strategyEdit', [SalesController::class, 'salesStrategyEdit']);
        Route::any('/sales/strategyDel', [SalesController::class, 'salesStrategyDel']);
        Route::any('/sales/multipleGoodsList', [SalesController::class, 'multipleGoodsList']);
        Route::any('/sales/multipleGoodsDel', [SalesController::class, 'multipleGoodsDel']);
        Route::any('/sales/promotionGoodsList', [SalesController::class, 'promotionGoodsList']);
        Route::any('/sales/defaultStrategyList', [SalesController::class, 'defaultStrategyList']);
        Route::any('/sales/defaultStrategyAdd', [SalesController::class, 'defaultStrategyAdd']);
        Route::any('/sales/defaultStrategyEdit', [SalesController::class, 'defaultStrategyEdit']);
        Route::any('/sales/defaultStrategyDel', [SalesController::class, 'defaultStrategyDel']);
        Route::any('/sales/defaultStrategyInfo/ajax', [SalesController::class, 'ajaxGetDefaultStrategyInfo']);


        # ==== 库存管理 ====
        # 库存管理 出库
        Route::get('/stock/enterOrderList', [StockOrderController::class, 'enterOrderList']);
        Route::any('/stock/enterOrderAdd', [StockOrderController::class, 'enterOrderAdd']);
        Route::any('/stock/enterOrderEdit', [StockOrderController::class, 'enterOrderEdit']);

        Route::get('/stock/outOrderList', [StockOrderController::class, 'outOrderList']);
        Route::any('/stock/outOrderEdit', [StockOrderController::class, 'outOrderEdit']);
        Route::any('/stock/outOrderAdd', [StockOrderController::class, 'outOrderAdd']);
        Route::any('/stock/outOrderGoods', [StockOrderController::class, 'outOrderGoods']);
        Route::any('/stock/orderPdf', [StockOrderController::class, 'orderPdf']);

        Route::any('/stock/repertoryOneOut', [StockOrderController::class, 'repertoryOneOut']);
        Route::any('/stock/repertoryOneEnter', [StockOrderController::class, 'repertoryOneEnter']);
        # 库存变动历史
        Route::any('/stock/repertoryList', [StockOrderController::class, 'repertoryList']);
        Route::any('/stock/repertoryLogList', [StockOrderController::class, 'repertoryLogList']);

        # ==== 商户管理 ====
        # 商户管理
        Route::get('/store/storeList', [StoreController::class, 'storeList']);
        Route::any('/store/storeAdd', [StoreController::class, 'storeAdd']);
        Route::any('/store/storeEdit', [StoreController::class, 'storeEdit']);
        Route::any('/store/storePassword', [StoreController::class, 'storePassword']);
        Route::any('/store/storeRecharge', [StoreController::class, 'storeRecharge']);
        Route::any('/store/storeGoodsEdit', [StoreController::class, 'storeGoodsEdit']);
        Route::any('/store/storeApply', [StoreController::class, 'storeApply']);
        Route::any('/store/storeApplyUn', [StoreController::class, 'storeApplyUn']);
        Route::any('/store/storeGoodsAdd', [StoreController::class, 'storeGoodsAdd']);
        Route::get('/store/storeGoodsViewPermissionsList', [StoreGoodsViewPermissionsListController::class, 'storeGoodsViewPermissionsList']);
        Route::get('/store/storeGoodsViewPermissionsEdit', [StoreGoodsViewPermissionsListController::class, 'storeGoodsViewPermissionsEdit']);
        Route::post('/store/updateGoodsPermission', [StoreGoodsViewPermissionsListController::class, 'updateGoodsPermission']);
        Route::post('/store/batchRevokePermission', [StoreGoodsViewPermissionsListController::class, 'batchRevokePermission']);
        Route::post('/store/batchGrantPermission', [StoreGoodsViewPermissionsListController::class, 'batchGrantPermission']);
        # 代理商配置销售策略权限
        Route::get('/store/salesStrategyViewPermissionsList', [SalesStrategyViewPermissionsListController::class, 'SalesStrategyViewPermissionsList']);
        Route::post('/store/updateSalesPermission', [SalesStrategyViewPermissionsListController::class, 'updateSalesPermission']);
        Route::post('/store/batchGrantSalesPermission', [SalesStrategyViewPermissionsListController::class, 'batchGrantSalesPermission']);
        Route::post('/store/batchRevokeSalesPermission', [SalesStrategyViewPermissionsListController::class, 'batchRevokeSalesPermission']);

        # ==== 商品管理 ====
        # 商品分类
        Route::any('/goods/categoryList', [GoodsController::class, 'goodsCategoryList']);
        Route::any('/goods/categoryAdd', [GoodsController::class, 'goodsCategoryAdd']);
        Route::any('/goods/categoryEdit', [GoodsController::class, 'goodsCategoryEdit']);
        Route::any('/goods/categoryDel', [GoodsController::class, 'goodsCategoryDel']);
        # 商品列表
        Route::any('/goods/goodsList', [GoodsController::class, 'goodsList']);
        Route::any('/goods/goodsList/ajax', [GoodsController::class, 'ajaxGetGoodsList']);
        Route::any('/goods/goodsList/json', [GoodsController::class, 'getGoodsListJson']);
        Route::any('/goods/goodsInfo/ajax', [GoodsController::class, 'ajaxGoodsInfo']);
        Route::any('/goods/goodsAdd', [GoodsController::class, 'goodsAdd']);
        Route::any('/goods/goodsEdit', [GoodsController::class, 'goodsEdit']);
        Route::any('/goods/goodsDel', [GoodsController::class, 'goodsDel']);

        # ==== 财务报表 ====
        # 代理商商品流水
        Route::any('/financial/agentGoodsList', [FinancialController::class, 'agentGoodsList']);
        # 代理商资金流水
        Route::any('/financial/agentFinancialList', [FinancialController::class, 'agentFinancialList']);
        # 商品统计
        Route::any('/financial/goodsStatistic', [FinancialController::class, 'goodsStatistic']);
        # 库存报表
        Route::any('/financial/inventoryReport', [FinancialController::class, 'inventoryReport']);
        # 商品台账
        Route::any('/financial/commodityParameter', [FinancialController::class, 'commodityParameter']);
        # 商品月报
        Route::any('/financial/goodsMonthlyReport', [FinancialController::class, 'goodsMonthlyReport']);
        # 代理商年报
        Route::any('/financial/agentYearReport', [FinancialController::class, 'agentYearReport']);
    });
});
